<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
    <title>智辉CRM</title>
    <meta name="keywords" content="智辉CRM">
    <meta name="description" content="智辉CRM">
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico" />
    <!--[if lt IE 9]> 
    <script type="text/javascript" src="Lib/html5.js"></script>
    <script type="text/javascript" src="Lib/respond.min.js"></script>
    <script type="text/javascript" src="Lib/PIE_IE678.js"></script>
    <![endif]-->
    <link href="__PUBLIC__/css/H-ui.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
    <!--自己的样式-->
    <link href="Tpl/Assistant/common/expense/expense_adding.css" rel="stylesheet" type="text/css">
    <!--[if IE 6]> 
    <script type="text/javascript" src="Lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('.pngfix,.icon');</script> 
    <![endif]-->
    <link href="__PUBLIC__/Validform/5.3.2/style.css" rel="stylesheet" type="text/css" />
    
    
    
</head>

<body>
    <div class="row pad">
        <div class="col-6">房屋名称：{$roomData['full_parent_name']}{$roomData['name']}</div>
        <div class="col-4">当前业主：{$roomData["householder_name"]}，{$roomData["householder_mobi"]}</div>
        <!--<div class="col-2"><a href="" class="f-r"><span>查看详情></span></a></div>-->
    </div>
    <div class="content">
        <div class="cont_left">
                <form method="post" action="{:U('Account/createAccount')}">
                    <input type="hidden" value="{$roomData['id']}" name="room_id"/>
                    <div class="row pad2">
                        <div class="col-3 margin_l2">该房屋下的缴费项目如下</div>
                        <div class="col-2 margin_l3"><input type="submit" class="btn btn-secondary-outline radius" value="生成账单" onClick="return confirm('是否生成账单并且微信通知业主缴费信息？ 请确认费用正确生成后无法更改')"></div>
                        <div class="col-2"><input id="go" type="button" class="btn btn-secondary-outline radius" value="查看账单"></div>
<!--
                        <div class="col-8">
                            <form action="" class="margin_l">
                            <select name="" id="">
                                <option value="">选择年度</option>
                                <volist name='year' id='v'>
                                <option value="{$v.value}">{$v.text}</option>
                                </volist>
                            </select>
                            <select name="" id="">
                                <option value="">选择状态</option>
                                <option value="1">已经缴纳</option>
                                <option value="0">还未缴纳</option>
                            </select>
                        </form>
                        </div>
-->

                    </div>
                    <div class="row pad3" id="message">
                        <div class="col">
                            <table class="table table-border table-bordered table-bg" id="pay">
                                <thead>
                                    <tr>
                                        <th><input type="checkbox" class="all1"></th>
                                        <th>缴费项目名称</th>
                                        <th>责任户主</th>
                                        <th>户主手机</th>
                                        <th>年度</th>
                                        <th>缴费截止</th>
                                        <th>需缴金额</th>
                                        <th>状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name='data' id='v'>
                                    <tr>
                                        <th>
                                            <if condition="$v['status']!=1 && $v['is_edit']!=0">
                                                <input type='checkbox' value="{$v.id}" name="expense_id[]">
                                            </if>
                                        </th>
                                        <td>{:getDicName('expenseType',$v['type'])}</td>
                                        <td>{$v.payer_name}</td>
                                        <td>{$v.payer_phone}</td>
                                        <td>{$v.year}</td>
                                        <td>{$v.close_time|date="Y.m.d",###}</td>
                                        <td>{$v.money}</td>
                                        <td>{$v['status']?'已缴纳':'未缴纳'}</td>
                                        <td id="btn">
                                        <span id="cha"><a href="javascript:to2('{:U('Expense/detail',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}');">查看</a></span>
                                        <if condition="$v['is_edit']!=0">
                                            <span id="bian"><a href="javascript:to3('{:U('Expense/edit',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}');">编辑</a></span>
                                            <span id="shan"><a href="{:U('Expense/delete',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}" onClick="return confirm('确认要删除？')" >删除</a></span>
                                            <!-- <a href="javascript:to2('{:U('Expense/detail',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}');"><input type="button" class="btn btn-secondary-outline radius width_b" value="查看"></a>
                                            <a href="javascript:to3('{:U('Expense/edit',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}');"><input type="button" class="btn btn-secondary-outline radius width_b" value="编辑"></a>
                                            <a href="{:U('Expense/delete',array('id'=>$v['id'],'room_id'=>$v['Room']['id']))}"><input type="button"  onClick="return confirm('确认要删除？')"  class="btn btn-secondary-outline radius width_b" value="删除"></a> -->
                                        </if>
                                        </td>
                                    </tr>
                                </volist>
                                    
                                </tbody>
                            </table>
                            <div style="text-align: center;margin-top: 10px">{$page}</div>
                        </div>
                    </div>
                </form> 
        </div>
        
        <div class="cont_right">
            <div class="row margin_t">
                <div class="col-12"><span>核对左侧已有的费用信息，勿重复添加费用！</span></div>
            </div>
            <div class="row">
                <div class="col-12"><span>房屋名称：{$roomData['full_parent_name']}{$roomData['name']}</span></div>
            </div>
            <form method="post" id="demoform" class="demoform padd">
                <input type="hidden" value="{$roomData['id']}" name='room_id'/>
<!--                <input type="hidden" value="{$roomData['community_id']}" name='community_id'/>
                <input type="hidden" value="{$roomData['zone_id']}" name='zone_id'/>
                <input type="hidden" value="{$roomData['building_id']}" name='building_id'/>
                <input type="hidden" value="{$roomData['unit_id']}" name='unit_id'/>-->
                <div class="row">
                    费用类型：<select name="type" id="" datatype="*1-10" errormsg="请填写正确的类型！">
                                <option value="">选择费用类型</option>
                                <volist name='type' id='v'>
                                <option value="{$v.value}">{$v.text}</option>
                                </volist>
                            </select>
                </div>
                <div class="row pad4">
                    费用金额：<input type="text" name='money' class="input-text size-MINI width_input" datatype="*1-10" errormsg="请填写正确的金额！"/>
                </div>
                <div class="row pad4">
                    责任户主：<input type="text" name='payer_name' class="input-text size-MINI width_input" value="{$roomData["householder_name"]}" datatype="*1-10" errormsg="请填写正确的户主名！"/>
                </div>
                <div class="row pad4">
                    手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：<input  type="text" name='payer_phone' value="{$roomData["householder_mobi"]}" class="input-text size-MINI width_input" />
                </div>
                <div class="row pad4">
                    费用年度：<select name="year" id="" datatype="*1-10" errormsg="请填写正确的年度！">
                                <option value="">选择费用年度</option>
                                <volist name='year' id='v'>
                                <option value="{$v.value}">{$v.text}</option>
                                </volist>
                            </select>
                </div>
                <div class="row pad4">
                    开始时间：<input type="text"  name="start_time" value="{$communityData.expense_start_time}" onfocus="WdatePicker()"  datatype="/^((?:19|20)\d\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/" errormsg="请填写正确的日期！"/>
                </div>
                <div class="row pad4">
                    结束时间：<input type="text"  name="end_time" value="{$communityData.expense_end_time}" onfocus="WdatePicker()" datatype="/^((?:19|20)\d\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/" errormsg="请填写正确的日期！"/>
                </div>
                <div class="row pad4">
                    截止时间：<input type="text" id='close_time'  name="close_time" value="{$communityData.expense_close_time}" onfocus="WdatePicker()"  datatype="/^((?:19|20)\d\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/" errormsg="请填写正确的日期！"/>
                </div>
                <div class="row pad4">
                    缴费状态：<select name="status" id="" datatype="*1-10" errormsg="请选择状态！">
                                <!--<option value="">选择缴费状态</option>-->
                                <option value="0">未缴费</option>
                                <option value="1">已缴费</option>
                            </select>
                </div>
           
<!--            <div class="xian"></div>-->
            <div class="row">
                <div class="col-12 posi">
                    <input class="btn btn-secondary-outline radius" type="submit" value="添加缴费项目">
                </div>
            </div>
         </form>
        </div>
    </div>


    
    
    
    
    <script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
    
    <script src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
    <!-- <script src="Tpl/Assistant/common/expense/layerui.js"></script> -->
    <script type="text/javascript" src="__PUBLIC__/Validform/5.3.2/Validform.min.js"></script>
    <script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
    <!--时间插件-->
    <script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/WdatePicker.js"></script>
    <!-- <script type="text/javascript" src="__PUBLIC__/datepicker/jquery-ui-1.9.2.custom.min.js"></script> -->
    <!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/datepicker/jquery-ui-1.9.2.custom.min.css" />     -->
<script>
    $(".demoform").Validform();
    // $( "input[name='start_time']" ).datepicker({dateFormat: "yy-mm-dd"});
    // $( "input[name='end_time']" ).datepicker({dateFormat: "yy-mm-dd"});
    // $( "input[name='close_time']" ).datepicker({dateFormat: "yy-mm-dd"});

    function to(url){
    layer.open({
        type: 2,
        title: '',
//        fix:false,
        area: ['980px', '523px'],
        content: url
    });

}

function to2(url){
    layer.open({
        type: 2,
        title: '缴费项目详情',
//        fix:false,
        area: ['400px', '480px'],
        content: url
    });

}

function to3(url){
    layer.open({
        type: 2,
        title: '',
//        fix:false,
        area: ['400px', '483px'],
        content: url
    });

}

// function ck(b)
// {
//     var input = document.getElementsByTagName("input");

//     for (var i=0;i<input.length ;i++ )
//     {
//         if(input[i].type=="checkbox")
//             input[i].checked = b;
//     }
// }

$(document).on("click",".all1",function(){
            if($('.all1').is(':checked')){
                $('#pay').find(':checkbox').prop("checked", true); 
            }else{
                $('#pay').find(':checkbox').attr("checked", false); 
            }
        });
$(document).on("click","#go",function(){
    parent.location.href="{:U('Account/lst',array('room_id'=>$roomData['id']))}";
});
</script>
</body>

</html>

